import React, { Component } from 'react';
import { connect } from 'dva';

import { createMap, getPoints } from "../utils";

@connect()
class ElectricityHeaderRight extends Component<any> {
  state = {
    map: null,
    marker: {}
  };

  componentDidMount() {
    // const { dispatch } = this.props;
    // dispatch({
    //   type: "analyse/getMapPoi",
    // }).then(() => {

    //   const { poi } = this.props;
    //   const marker = getPoints(map, poi, this.props.active);

    //   this.setState({
    //     map,
    //     marker
    //   })
    // })
    let map = createMap({
      container: "electricityMap",
      enableMapClick: false,
      location: [104.705518975, 35.5047012581],
      level: 5,
      overviewMapControl: true,
      enableScrollWheelZoom: true,
      disable3DBuilding: true,
    });
  }

  render() {
    return (
      <div className="head-left">
        <div id="electricityMap" style={{ width: "95%", height: "300px" }} />
      </div>
    )
  }
}

export default ElectricityHeaderRight
